************************************************************************************
****REPLICATION DO-FILE FOR ********************************************************
*Does Polygyny cause Intergroup Conflict? Re-examining Koos and Neupert-Wentz (2020)
*****THIS FILE REPLICATES ACLED AND GED DATA FIRST (TABLES 1, 2, 3, 4, A1, A2, A3, A4,
*****A5, A6, A7, A8, A9, A10)*******************************************************
****REPLICATION FOR AFROBAROMETER DATA FOLLOWS (TABLES 5, 6, 7, A11, A12, A13, A14, A15)
****buffer_recalculation.R contains replication for shapefiles and Figure A1*******

***************************************************************************************
****GENERATE DATA WITHOUT DUPLICATE EVENTS, INTRAGROUP VIOLENCE AND FOR FATALITIES*****
****ALL .CSV EVENT FILES PROVIDED BY KOOS AND NEUPERT-WENTZ****************************
***************************************************************************************
#delimit;
clear;
cd "C:\Users\kash8\OneDrive\Documents\GIS\Koos and Neupert-Wentz JCR Replication\kash2022_rap_forthcoming_replication"; 
***Collapse to remove duplicates***;

insheet using "acled_main.csv";
collapse (first) notes (max) intraethnic, by(year name source country  actor2 admin1 admin2 admin3 location latitude longitude actor1acled);
gen join_countn100=1;
outsheet using acled_mod.csv, comma replace;
collapse (sum)   join_countn100, by( name);
sort name;
rename join_countn100 acled_mod;
save acled_mod,replace;

clear;
insheet using "borders50_acled_join.csv";
collapse (first) notes (max) join_count, by(yearn166 name sourcec254 countryc254 actor2c254 admin1c254 admin2c254 admin3c254 locationc254 latituden166 longituden166 actor1c254);
collapse (sum)   join_count, by( name);
sort name;
rename join_count acled_mod50;
save acled50_mod,replace;





***Aggregate Fatalities***;
clear;
insheet using "borders_acled_join.csv";
collapse (sum)   fatalities, by( name);
sort name;
rename fatalities acled_fatalities;
save acled_fatalities,replace;

#delimit;
clear;
insheet using "borders50_acled_join.csv";
collapse (sum)   fatalities, by( name);
sort name;
rename fatalities acled50_fatalities;
save acled50_fatalities,replace;

***PRIO-GED Aggregate Fatalities***;
clear;
insheet using "ged_marshall_spatial_join.csv";
collapse (sum)   fatalities_best, by( name);
sort name;
rename fatalities_best ged_fatalities;
save ged_fatalities,replace;

clear;
insheet using "ged_marshall_spatial_join50.csv";
collapse (sum)   fatalities_best, by( name);
sort name;
rename fatalities_best ged50_fatalities;
save ged50_fatalities,replace;

***Aggregate Fatalities***;
#delimit;
clear;
insheet using "borders_acled_join.csv";
gen intraethnic=0;
replace intraethnic=1 if  actor1c254==actor2c254 ;
replace intraethnic=1 if  actor2c254 =="";
drop if intraethnic==1;
collapse (sum)   fatalities, by( name);
sort name;
rename fatalities acled_fatalities_inter;
save acled_fatalities_inter,replace;

clear;
insheet using "borders50_acled_join.csv";
gen intraethnic=0;
replace intraethnic=1 if  actor1c254==actor2c254 ;
replace intraethnic=1 if  actor2c254 =="";
drop if intraethnic==1;
collapse (sum)   fatalities, by( name);
sort name;
rename fatalities acled50_fatalities_inter;
save acled50_fatalities_inter,replace;

***PRIO-GED Aggregate Fatalities***;
clear;
insheet using "ged_marshall_spatial_join.csv";
collapse (sum)   fatalities_best, by( name);
sort name;
rename fatalities_best ged_fatalities_inter;
save ged_fatalities_inter,replace;

clear;
insheet using "ged_marshall_spatial_join50.csv";
collapse (sum)   fatalities_best, by( name);
sort name;
rename fatalities_best ged50_fatalities_inter;
save ged50_fatalities_inter,replace;

****Merging into Main Data****;

****************************************************************************************;
***KNW REPLICATION DATA MODIFIED TO BE COMPATIBLE WITH STATA 10 - OTHERWISE IDENTICAL***;
****************************************************************************************;

use polygyny_intergroup_conflict_final_ash_10;
drop   acled_mod acled_mod50 acled_mod_inter acled_mod50_inter acled_fatalities acled50_fatalities ged_fatalities ged50_fatalities duplicates duplicates50;
sort name;
merge name using acled_mod;
drop _merge;
sort name;
merge name using acled50_mod;
drop _merge;
sort name;
merge name using acled_fatalities;
drop _merge;
sort name;
merge name using acled50_fatalities;
drop _merge;
sort name;
merge name using ged_fatalities;
drop _merge;
sort name;
merge name using ged50_fatalities;
drop _merge;
drop if ccode=="";
replace  acled_fatalities=0 if acled_fatalities==.;
replace  acled_mod=0 if acled_mod==.;
replace  acled_mod50=0 if acled_mod50==.;
replace  acled50_fatalities=0 if acled50_fatalities==.;
replace  ged_fatalities=0 if ged_fatalities==.;
replace  ged50_fatalities=0 if ged50_fatalities==.;


gen acl_com_bin=acl_com;
replace acl_com_bin=1 if acl_com_bin>1;
gen acl_com50_bin=acl_com50;
replace acl_com50_bin=1 if acl_com50_bin>1;
gen ged_com_bin=ged_com;
replace ged_com_bin=1 if ged_com_bin>1;
gen ged_com50_bin=ged_com50;
replace ged_com50_bin=1 if ged_com50_bin>1;

gen acled_fatalities_ln=ln(acled_fatalities);
gen acled50_fatalities_ln=ln(acled50_fatalities);
gen ged_fatalities_ln=ln(ged_fatalities);
gen ged50_fatalities_ln=ln(ged50_fatalities);
replace  acled_fatalities_ln=0 if acled_fatalities_ln==.;
replace  acled50_fatalities_ln=0 if acled50_fatalities_ln==.;
replace  ged_fatalities_ln=0 if ged_fatalities_ln==.;
replace  ged50_fatalities_ln=0 if ged50_fatalities_ln==.;

save polygyny_intergroup_conflict_final_ash_10,replace;

total acl_com  acl_com50 acled_mod acled_mod50 acled_mod_inter acled_mod50_inter acled_fatalities acled50_fatalities;
total ged_com ged_com50 ged_fatalities ged50_fatalities;
#delimit;
global expvar rsh_p_pg ;
global in_marriage in_pg ;
global controls     lnkm2group lpop60 sead mean_elev mean_suit malaria  empire distemp city1400 distcon lnslexports1 share_muslim agri_intense; 
global controls_red lnkm2group lpop60      mean_elev mean_suit          empire distemp city1400 distcon lnslexports1 share_muslim agri_intense ;


****TABLES 1 and 2: Original Models***;

#delimit;
xi: nbreg acl_com  $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo a1;
xi: nbreg acl_com  $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo a2;
xi: nbreg ged_com $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo a3;
xi: nbreg ged_com $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo a4;
estout a1 a2 a3 a4 using original.tex, replace cells(b(star fmt(%9.3f)) se(par) ) stats(aic bic pr2  r2 N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

#delimit;
xi: nbreg acl_com50 $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo g1;
xi: nbreg acl_com50 $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo g2;
xi: nbreg ged_com50 $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo g3;
xi: nbreg ged_com50 $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo g4;
estout g1 g2 g3 g4 using original50.tex, replace cells(b(star fmt(%9.3f)) se(par))  stats(aic bic pr2 r2 N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

***TABLES 3 and 4: Fatalities****


#delimit;
xi: reg acled_fatalities_ln $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo d1;
xi: reg acled_fatalities_ln $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo d2;
xi: reg ged_fatalities_ln $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo h1;
xi: reg ged_fatalities_ln $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo h2;
estout d1 d2 h1 h2 using fatalities_ols_ln.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic pr2 r2 N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

#delimit;
xi: reg acled50_fatalities_ln $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo d3;
xi: reg acled50_fatalities_ln $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo d4;
xi: reg ged50_fatalities_ln $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo h3;
xi: reg ged50_fatalities_ln $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo h4;
estout d3 d4 h3 h4 using fatalities50_ols_ln.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic pr2 r2  N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 



***MENTIONED IN TEXT: Correlations between Fatalities and Events Data****;


corr  acled_fatalities acled_fatalities_ln acl_com acl_com_bin ;
corr  ged_fatalities ged_fatalities_ln ged_com ged_com_bin ;


*****************
****APPENDIX*****
*****************

****TABLE A1: Summary statistics****;
summarize acl_com acl_com50 ged_com ged_com50 $expvar $in_marriage $controls  acled_fatalities acled50_fatalities ged_fatalities ged50_fatalities  acled_fatalities_ln acled50_fatalities_ln ged_fatalities_ln ged50_fatalities_ln acl_com_bin acl_com50_bin ged_com_bin ged_com50_bin;

****TABLE A2: ACLED No Duplicates****;
#delimit;
xi: nbreg acled_mod $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo b1;
xi: nbreg acled_mod $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo b2;
xi: nbreg acled_mod50 $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo b3;
xi: nbreg acled_mod50 $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo b4;
estout b1 b2 b3 b4 using noduplicates.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 


***TABLES A3 and A4: Fatalities: NBreg****;
#delimit;
xi: nbreg acled_fatalities $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo d1;
xi: nbreg acled_fatalities $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo d2;
xi: nbreg  ged_fatalities $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo h1;
xi: nbreg  ged_fatalities $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo h2;
estout d1 d2 h1 h2 using fatalities.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic pr2 r2 N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

#delimit;
xi: nbreg acled50_fatalities $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo d3;
xi: nbreg acled50_fatalities $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo d4;
xi: nbreg  ged50_fatalities $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) difficult;
eststo h3;
xi: nbreg  ged50_fatalities $expvar $in_marriage $controls         i.ccode, cluster(ccode) difficult;
eststo h4;
estout d3 d4 h3 h4 using fatalities50.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic pr2 r2  N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

***TABLES A5 and A6: Fatalities: OLS, no log***

#delimit;
xi: reg acled_fatalities $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo d1;
xi: reg acled_fatalities $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo d2;
xi: reg ged_fatalities $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo h1;
xi: reg ged_fatalities $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo h2;
estout d1 d2 h1 h2 using fatalities_ols.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic pr2 r2 N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

#delimit;
xi: reg acled50_fatalities $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo d3;
xi: reg acled50_fatalities $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo d4;
xi: reg ged50_fatalities $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo h3;
xi: reg ged50_fatalities $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo h4;
estout d3 d4 h3 h4 using fatalities50_ols.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic pr2 r2  N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

***TABLES A7 and A8: Binary Events***
#delimit;
xi: logit acl_com_bin  $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo a1;
xi: logit acl_com_bin  $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo a2;
xi: logit ged_com_bin $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo g1;
xi: logit ged_com_bin $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo g2;
estout a1 a2 g1 g2 using binary.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic pr2 r2  N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

#delimit;
xi: logit acl_com50_bin $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo a3;
xi: logit acl_com50_bin $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo a4;
xi: logit ged_com50_bin $expvar $in_marriage lnkm2group lpop60 i.ccode, cluster(ccode) ;
eststo g3;
xi: logit ged_com50_bin $expvar $in_marriage $controls         i.ccode, cluster(ccode) ;
eststo g4;
estout a3 a4 g3 g4 using binary50.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic pr2 r2 N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

***********TABLES A9 and A10;

list name  acl_com acled_fatalities      rsh_p_pg if acl_com>69;
list name  ged_com ged_fatalities      rsh_p_pg if ged_com>29;

****MENTIONED IN APPENDIX 9: Descriptive Statistics for Qualitative Cases***;

list  name if cluster=="Fulani";
list  name in_pg if ccode=="ZAF";
total  ged_com ged_com50 if ccode=="ZAF";


***************************************************************************************;
****USING KNW's AFROBAROMETER DATA ADAPTED FOR STATA 10 - OTHERWISE IDENTICAL**********;
***************************************************************************************;
#delimit;
clear;
use afrobarometer10.dta;



****TABLE 6: Additional Models for Men with or without children****;
tab nochildren urbrur if female==0,co;
ttest nochildren if  urban_dum==0 & female==0, by(polygyny);
ttest nochildren if  urban_dum==1 & female==0, by(polygyny);

ttest nochildren if  urban_dum==0 & age<40 & female==0, by(polygyny);
ttest nochildren if  urban_dum==1 & age<40 & female==0, by(polygyny);

***Children for Men across Age Groups***
ttest nochildren if age<26 & female==0, by(polygyny);
ttest nochildren if age<36 & age>25 & female==0, by(polygyny);
ttest nochildren if age<46 & age>35 & female==0, by(polygyny);
ttest nochildren if age>45 & female==0, by(polygyny);

ttest nochildren if urban_dum==0 &age<26 & female==0, by(polygyny);
ttest nochildren if urban_dum==0 &age<36 & age>25 & female==0, by(polygyny);
ttest nochildren if urban_dum==0 &age<46 & age>35 & female==0, by(polygyny);
ttest nochildren if urban_dum==0 &age>45 & female==0, by(polygyny);

ttest nochildren if urban_dum==1 & age<26 & female==0, by(polygyny);
ttest nochildren if urban_dum==1 & age<36 & age>25 & female==0, by(polygyny);
ttest nochildren if urban_dum==1 & age<46 & age>35 & female==0, by(polygyny);
ttest nochildren if urban_dum==1 & age>45 & female==0, by(polygyny);



global controls age age2 edu assets urban_dum;


****TABLE 5: Original Model***;

#delimit;
reg  use_violence_d  polygyny age age2 edu assets urban_dum if female==0 & age<40 & nochildren==1 ,robust;
eststo c1;
reg  treated_unequally polygyny age age2 edu assets urban_dum if female==0 & age<40 & nochildren==1 ,robust;
eststo c2;
reg  use_violence_d  polygyny age age2 edu assets urban_dum if female==0 & age>40   ,robust;
eststo c3;
reg  treated_unequally polygyny age age2 edu assets urban_dum if female==0 & age>40 ,robust;
eststo c4;
reg  use_violence_d  polygyny age age2 edu assets urban_dum if female==1 ,robust;
eststo c5;
reg  treated_unequally polygyny age age2 edu assets urban_dum if female==1 ,robust;
eststo c6;
estout c2 c1 c4 c3 c6 c5 using ab_original.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic r2_a N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 


****TABLE 7: Rural respondents only****;

#delimit;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age<40 & nochildren==1 & urban_dum==0 ,robust;
eststo c1;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age<40 & nochildren==1 & urban_dum==0 ,robust;
eststo c2;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age>40  & urban_dum==0 ,robust;
eststo c3;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age>40 & urban_dum==0 ,robust;
eststo c4;
reg  use_violence_d  polygyny age age2 edu assets if female==1 & urban_dum==0 ,robust;
eststo c5;
reg  treated_unequally polygyny age age2 edu assets if female==1 & urban_dum==0 ,robust;
eststo c6;
estout c2 c1 c4 c3 c6 c5 using ab_rural.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

******************************************************;
*******AFROBAROMETER MODELS IN APPENDIX***************;
******************************************************;

****TABLE A11: Multivariate Logistic Model for Having Children among Men ****;

#delimit;
logit  nochildren  polygyny age age2 edu assets urban_dum if female==0;
eststo no1;
logit  nochildren  polygyny age age2 edu assets urban_dum if female==0 & age<40 ; 
eststo no2;
logit  nochildren  polygyny age age2 edu assets urban_dum if female==0 & age>39;
eststo no3;
logit  nochildren  polygyny age age2 edu assets urban_dum if female==0 & age<40 & urban_dum==0; 
eststo no4;
logit  nochildren  polygyny age age2 edu assets urban_dum if female==0 & age<40 & urban_dum==1 ; 
eststo no5;
estout no1 no2 no3 no4 no5 using ab_nochildren.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(aic bic r2_a N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

****TABLE A12: Urban respondents only****;



#delimit;
reg  use_violence_d  polygyny age age2 edu assets  if female==0 & age<40 & nochildren==1  & urban_dum==1,robust;
eststo d1;
reg  treated_unequally polygyny age age2 edu assets  if female==0 & age<40 & nochildren==1 & urban_dum==1,robust;
eststo d2;
reg  use_violence_d  polygyny age age2 edu assets  if female==0 & age>40  & urban_dum==1,robust;
eststo d3;
reg  treated_unequally polygyny age age2 edu assets  if female==0 & age>40 & urban_dum==1,robust;
eststo d4;
reg  use_violence_d  polygyny age age2 edu assets  if female==1  & urban_dum==1,robust;
eststo d5;
reg  treated_unequally polygyny age age2 edu assets  if female==1 & urban_dum==1,robust;
eststo d6;
estout d2 d1 d4 d3 d6 d5 using ab_urban.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 



****TABLES A13, A14 and A15: Raising and lowering age by 5 years****;

#delimit;
reg  use_violence_d  polygyny age age2 edu assets urban_dum if female==0 & age<36 & nochildren==1 ,robust;
eststo c1;
reg  treated_unequally polygyny age age2 edu assets urban_dum if female==0 & age<36 & nochildren==1 ,robust;
eststo c2;
reg  use_violence_d  polygyny age age2 edu assets urban_dum if female==0 & age>35   ,robust;
eststo c3;
reg  treated_unequally polygyny age age2 edu assets urban_dum if female==0 & age>35 ,robust;
eststo c4;
reg  use_violence_d  polygyny age age2 edu assets urban_dum if female==0 & age<46 & nochildren==1 ,robust;
eststo c5;
reg  treated_unequally polygyny age age2 edu assets urban_dum if female==0 & age<46 & nochildren==1 ,robust;
eststo c6;
reg  use_violence_d  polygyny age age2 edu assets urban_dum if female==0 & age>45   ,robust;
eststo c7;
reg  treated_unequally polygyny age age2 edu assets urban_dum if female==0 & age>45 ,robust;
eststo c8;
estout c2 c1 c4 c3 c6 c5 c8 c7 using ab_original3545.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 



#delimit;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age<36 & nochildren==1 & urban_dum==0 ,robust;
eststo c1;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age<36 & nochildren==1 & urban_dum==0 ,robust;
eststo c2;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age>35  & urban_dum==0 ,robust;
eststo c3;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age>35 & urban_dum==0 ,robust;
eststo c4;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age<46 & nochildren==1 & urban_dum==0 ,robust;
eststo c5;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age<46 & nochildren==1 & urban_dum==0 ,robust;
eststo c6;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age>45  & urban_dum==0 ,robust;
eststo c7;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age>45 & urban_dum==0 ,robust;
eststo c8;



estout c2 c1 c4 c3 c6 c5 c8 c7 using ab_rural3545.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 

#delimit;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age<36 & nochildren==1 & urban_dum==1 ,robust;
eststo d1;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age<36 & nochildren==1 & urban_dum==1 ,robust;
eststo d2;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age>35  & urban_dum==1 ,robust;
eststo d3;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age>35 & urban_dum==1 ,robust;
eststo d4;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age<46 & nochildren==1 & urban_dum==1 ,robust;
eststo d5;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age<46 & nochildren==1 & urban_dum==1 ,robust;
eststo d6;
reg  use_violence_d  polygyny age age2 edu assets if female==0 & age>45  & urban_dum==1 ,robust;
eststo d7;
reg  treated_unequally polygyny age age2 edu assets if female==0 & age>45 & urban_dum==1 ,robust;
eststo d8;
estout d2 d1 d4 d3 d6 d5 d8 d7 using ab_urban3545.tex, replace cells(b(star fmt(%9.3f)) se(par)) stats(r2_a N, fmt(%9.3f %9.0g))  legend label collabels(none) varlabels(_cons Constant) style(tex); 


